<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>享送小哥</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
</head>

<body>
    <div class="aui-content">
        <header class="aui-bar aui-bar-nav aui-bar-light u-aui-bar">
            <a class="aui-pull-left aui-btn" onclick="javascript:api.closeWin();"> <span class="aui-iconfont aui-icon-left"></span> </a>
            <div class="aui-title u-aui-title">密码登入</div>
        </header>
        <div class="aui-content aui-margin-b-15">
            <div class="login-t1"></div>
            <ul class="aui-list aui-form-list aui-form-list2">
                <li class="aui-list-item aui-padded-l-5">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label-icon"> <i class="aui-iconfont aui-icon-mobile"></i> </div>
                        <div class="aui-list-item-input">
                            <input placeholder="请输入手机号码" type="tel" class="u-inp1" maxlength="11" v-model="phone">
                        </div>
                    </div>
                </li>
                <li class="aui-list-item aui-padded-l-5">
                    <div class="aui-list-item-inner bor-bn">
                        <div class="aui-list-item-label-icon"> <i class="aui-iconfont aui-icon-lock2"></i> </div>
                        <div class="aui-list-item-input">
                            <input placeholder="请输入您的密码" type="password" class="u-inp1" v-model="password">
                        </div>
                    </div>
                </li>
            </ul>
            <input class="aui-btn aui-btn-info login-sub2 mt40" value="登入" @click="login">
            <div class="logon-zc aui-margin-t-15"><a href="javascript:;" class="fl blue" @click="regist">立即注册</a><a href="javascript:;" class="fr c-6" @click="forget">忘记密码</a></div>
        </div>
    </div>
    <script type="text/javascript" src="../script/api.js"></script>
    <script type="text/javascript" src="../script/vue.js"></script>
    <script type="text/javascript" src="../script/app.js"></script>
    <script type="text/javascript">
        apiready = function() {
            app.statusBar.set();
        }
        new Vue({
            el: ".aui-content",
            data: {
                phone: "",
                password: ""
            },
            methods: {
                login: function() {
                    app.request.post('Client/login', {
                        type: 'password',
                        phone: this.phone,
                        password: this.password
                    }, {}, function(res) {
                        if (res.code == 200) {
                            app.loginSuccess(res, function() {});
                            api.closeWin({
                                name: "login0"
                            })
                            api.closeWin();
                        } else {
                            app.error(res.message);
                        }
                    });
                },
                regist: function() {
                    app.page({
                        name: "regist",
                        url: "./regist.html"
                    })
                },
                forget: function() {
                    app.page({
                        name: "forget",
                        url: "./forget.html"
                    })
                }
            }
        })
    </script>
</body>

</html>
